var Dao = require('./DAO')
//针对用户的数据表操作的模块对象
var indexDAO = {
    getAlladdress:function(callback){
        Dao('select shopName,shopCity from stopaddress ',null,function(err,results){
            if(err){
              callback(err,null)
            }else{
              callback(null,results)
            }
        })
      },
      getspinonce:function(spin,callback){
        Dao('insert into integral(userId,integralonce,integralsource,integraltime)values(?,?,?,now())',
        [spin.userId,spin.integralonce,spin.integralsource],
        function(err,results){
            if(err){
              console.log(err)
              callback(err,null)
            }else{
              callback(null,results)
            }
        })
      },
      getAllmap:function(callback){
        Dao('select Longitude,latitude from stopaddress ',null,function(err,results){
            if(err){
              callback(err,null)
            }else{
              callback(null,results)
            }
        })
      },
}
module.exports = indexDAO